package com.tedu.controller;

import com.tedu.Common.web.JsonResult;
import com.tedu.pojo.param.BookParam;
import com.tedu.service.IBookService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.validation.Valid;

@Slf4j
@Repository
@RequestMapping("/")
public class BookController {
    
    @Autowired
    private IBookService bookService;

    @PostMapping("/")
    public JsonResult addNew(@Valid BookParam bookParam){
        bookService.addNew(bookParam);
        return JsonResult.ok();
    }
}
